package com.boy.rpc.framework.console.workbench;

import com.boy.rpc.framework.console.workbench.constant.WebConstant;

/**
 * Created by wesley on 2017-03-16.
 */
public enum WorkbenchCodeEnum implements WebConstant {
    OK_REDIS_KV_UPDATE("20010001", "update success"),
    OK_SUCCESS("20010000", "SUCCESS"),;

    private String code;
    private String msg;

    WorkbenchCodeEnum(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public String getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    public String getStatus() {
        if (this.getCode().indexOf("2") == 0) {
            return SUCCESS;
        }
        return FAILURE;
    }
}
